<div class="judul"><?php echo "$title";?></div>
<?php
  $flashdata = $this->session->flashdata('message');
  $messages = isset ($flashdata)?pesan($flashdata):"";
  echo "$messages";
?>
<script type="text/javascript">
    $(document).ready(function(){
        $('input[type=submit]').click(function(){
            if($('#oldpass').val() == ""){
                alert('Password lama harus diisi');
                $('#oldpass').focus();
                return false;
            }
            if($('#newpass').val() == ""){
                alert('Password baru harus diisi');
                $('#newpass').focus();
                return false;
            }
            if($('#confirmpass').val() == ""){
                alert('Konfirmasi password harus diisi');
                $('#confirmpass').focus();
                return false;
            }
            if($('#newpass').val() != $('#confirmpass').val()){
                alert('Password konfirmasi salah');
                $('#confirmpass').val('');
                $('#confirmpass').focus();
                return false;
            }
        })
    })
</script>
<div class="data-input">
    <fieldset>
        <?php
          foreach($listUser as $row);
          echo form_open($subLink, '');
        ?>
        <label>Nama</label><span style="font-size: 11px; padding-top: 6px; "><?php echo $row['nama'];?></span>
        <label>Username</label><span style="font-size: 11px; padding-top: 6px; "><?php echo $row['username'];?></span>
        <label>Password Lama</label><?php echo form_password("oldpass", "", "id='oldpass'");?>
        <label>Password Baru</label><?php echo form_password("newpass", "", "id='newpass'");?>
        <label>Konfirmasi Password</label><?php echo form_password("confirmpass", "", "id='confirmpass'");?>
        <fieldset class="input-process">
          <?php  
            echo form_hidden('id', $row['id']);
            echo form_submit('edit', 'Simpan', 'class=button style=margin-right:2px');
            echo form_button('Batal', 'Batal', 'class=button onClick='."javascript:location.href='".base_url()."index.php/password/'".'');
          ?>
        </fieldset>
        <?php
          echo form_close();
        ?>
    </fieldset>
</div>